//
//  Book.m
//  UI_17_sandBox
//
//  Created by li cheng on 16/8/5.
//  Copyright © 2016年 li cheng. All rights reserved.
//

#import "Book.h"

@implementation Book
- (instancetype)initWithCoder:(NSCoder *)aDecoder{
    self = [super init];
    if (self) {
        // 取值
        _bookName = [aDecoder decodeObjectForKey:@"bookName"];
        _bookAddress = [aDecoder decodeObjectForKey:@"bookAddress"];
        _bookName = [aDecoder decodeObjectForKey:@"bookName"];
        _bookPrice = [aDecoder decodeObjectForKey:@"bookPrice"];
        _bookAuthor = [aDecoder decodeObjectForKey:@"bookAuthor"];
    }
    return self;
}
// 赋值,存储
- (void)encodeWithCoder:(NSCoder *)aCoder{
    [aCoder encodeObject:_bookName forKey:@"bookName"];
    [aCoder encodeObject:_bookType forKey:@"boolType"];
    [aCoder encodeObject:_bookPrice forKey:@"bookPrice"];
    [aCoder encodeObject:_bookAuthor forKey:@"bookAuthor"];
    [aCoder encodeObject:_bookAddress forKey:@"bookAddress"];
}
@end
